<template>
	<!-- 设备工单 -->
	<view class="wrap">
		<view class="device-info-item" @click="toDeviceList">
			<view style="width: 100rpx;padding-bottom: 20rpx;">设备</view>
			<view class="select-right">
				<text>{{device.name}}</text>
				<u-icon name="arrow-right"></u-icon>
			</view>
		</view>
		<view class="device-info-item">
			<view style="width: 100rpx;padding-bottom: 20rpx;">信息</view>
			<view class="select-right">
				<text>{{ device.mac }}</text>
				<text>{{ device.no }}</text>
				<text>{{ device.busNo }}</text>
			</view>
		</view>
		<view class="device-info-item">
			<view style="width: 100rpx;">描述</view>
			<u-input v-model="textValue" style="flex: 1;" type="textarea" :border="true" :height="200" :auto-height="true" />
		</view>
		<u-button type="primary">提交</u-button>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				device:{
					name:'请选择设备'
				},
				textValue:''
			}
		},
		created(){
			console.log('onLoad===============	')
			this.$EventBus.$on('deviceSelect',this.deviceSelect)
		},
		destroyed(){
			this.$EventBus.$off('deviceSelect')
		},
		methods:{
			toDeviceList(){
				this.$u.route('/pages/deviceList/index')
			},
			deviceSelect(val){
				console.log('deviceSelect--------------',val)
				this.device = val
			},
		}
	}
</script>

<style scoped lang="scss">
	.wrap{
		display: flex;
		flex-direction: column;
		.device-info-item{
			display: flex;
			flex-direction: row;
			align-items: center;
			padding: 20rpx;
			.select-right{
				flex: 1;
				display: flex;
				flex-direction: row;
				justify-content: space-between;
				border-bottom: 1px solid #e9e9e9;
				padding-bottom: 20rpx;
			}
		}
	}
</style>
